﻿<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="wucThemBenhAn.ascx.cs"
    Inherits="HeathCareSystem.wuc.wucThemBenhAn" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
<style type="text/css">
    
    .style1
    {
        height: 30px;
    }
    
</style>
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
    <ContentTemplate>
        <asp:Panel ID="pnlBenhAn" runat="server">
        <table align="center" class="style1" width="100%">
            <tr>
                <td align="center" colspan="2" 
                    style="font-size: xx-large; font-weight: bold; color: #800000;">
                    Hồ Sơ Bệnh Án
                </td>
            </tr>
            <tr>
                <td>
                    Mã Phiếu Khám:
                </td>
                <td>
                    <asp:TextBox ID="txtMa" runat="server" Height="23px" Width="187px" 
                        Enabled="False"></asp:TextBox>
                </td>
            </tr>
            <tr>
                <td>
                    Tên Bệnh Nhân:</td>
                <td>
                    <asp:TextBox ID="txtTen_HoSoBenhAn" runat="server" Enabled="False" 
                        Height="23px" Width="187px"></asp:TextBox>
                </td>
            </tr>
            <tr>
                <td>
                    Ngày Khám:
                </td>
                <td>
                    <asp:TextBox ID="txtNgay" runat="server" Height="29px" Width="186px"></asp:TextBox>
                    <asp:CalendarExtender ID="txtNgay_CalendarExtender" runat="server" TargetControlID="txtNgay"
                        Format="MM/dd/yyyy">
                    </asp:CalendarExtender>
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" 
                        ControlToValidate="txtNgay" Display="Dynamic" ErrorMessage="* Nhập ngày khám" 
                        ValidationGroup="HoSo"></asp:RequiredFieldValidator>
                </td>
            </tr>
            <tr>
                <td>
                    Triệu Chứng:
                </td>
                <td>
                    <asp:TextBox ID="txtTrieuChung" runat="server" Height="27px" Width="185px"></asp:TextBox>
                </td>
            </tr>
            <tr>
                <td>
                    Chuẩn Đoán:
                </td>
                <td>
                    <asp:DropDownList ID="ddlChanDoan" runat="server" Height="21px" Width="186px">
                    </asp:DropDownList>
                </td>
            </tr>
            <tr>
                <td>
                    Danh Sách Xét Nghiệm:
                </td>
                <td>
                    <asp:LinkButton ID="lbtnXetNghiem" runat="server" Enabled="False" 
                        onclick="lbtnXetNghiem_Click">Phiếu Xét Nghiệm</asp:LinkButton>
                </td>
            </tr>
            <tr>
                <td>
                    Danh Sách Toa Thuốc:
                </td>
                <td>
                    <asp:LinkButton ID="lbtnThuoc" runat="server" onclick="lbtnThuoc_Click" 
                        Enabled="False">Toa Thuốc</asp:LinkButton>
                </td>
            </tr>
            <tr>
                <td>
                    Kết Luận:
                </td>
                <td>
                    <asp:TextBox ID="txtKetLuan" runat="server" Height="24px" Width="255px" TextMode="MultiLine"></asp:TextBox>
                </td>
            </tr>
            <tr>
                <td class="style1">
                    Ngày Tái Khám:
                </td>
                <td class="style1">
                    <asp:TextBox ID="txtNgayTai" runat="server" Height="23px" Width="187px"></asp:TextBox>
                    <asp:CalendarExtender ID="txtNgayTai_CalendarExtender" runat="server" TargetControlID="txtNgayTai"
                        Format="MM/dd/yyyy">
                    </asp:CalendarExtender>
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" 
                        ControlToValidate="txtNgayTai" Display="Dynamic" 
                        ErrorMessage="* Nhập ngày tái khám" ValidationGroup="HoSo"></asp:RequiredFieldValidator>
                </td>
            </tr>
            <tr>
                <td colspan="2" align="center">
                    &nbsp;<asp:Button ID="btnThem" runat="server" Text="Thêm Hồ Sơ" 
                        OnClick="btnThem_Click" ValidationGroup="HoSo" />
                    &nbsp;<asp:Button ID="btnLamMoi" runat="server" Text="Làm mới" Height="24px" Width="97px"
                        OnClick="btnThoat_Click" />
                </td>
            </tr>
        </table>
        <div>
            <asp:Label ID="lblThongBao" runat="server" Font-Size="14pt" ForeColor="#FF3300"></asp:Label>
        </div>
        <div>
            <asp:GridView ID="gvThongTinBN" runat="server" Style="margin-top: 0px" Width="100%"
                AutoGenerateColumns="False" CellPadding="4" EnableModelValidation="True" ForeColor="#333333"
                GridLines="None" OnPageIndexChanging="gvThongTinBN_PageIndexChanging" OnRowCommand="gvThongTinBN_RowCommand"
                OnSelectedIndexChanging="gvThongTinBN_SelectedIndexChanging">
                <AlternatingRowStyle BackColor="White" />
                <Columns>
                    <asp:ButtonField ButtonType="Image" CommandName="MaPhieuKham" DataTextField="MaPhieuKham"
                        HeaderText="Bệnh án" ImageUrl="~/App_Themes/Guest/Images/icon-detail.png" Text="Button" />
                    <asp:BoundField DataField="MaPhieuKham" HeaderText="Mã phiếu khám" />
                    <asp:BoundField DataField="HoTen" HeaderText="Họ tên" />
                    <asp:BoundField DataField="GioiTinh" HeaderText="Giới tính" />
                    <asp:BoundField DataField="NgaySinh" HeaderText="Ngày sinh" />
                    <asp:BoundField DataField="SoDienThoai" HeaderText="Số điện thoại" />
                    <asp:BoundField DataField="QueQuan" HeaderText="Quê quán" />
                </Columns>
                <EditRowStyle BackColor="#2461BF" />
                <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                <HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
                <RowStyle BackColor="#EFF3FB" />
                <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
            </asp:GridView>
        </div>
        </asp:Panel>

        <asp:Panel ID="pnlToaThuoc" runat="server">
        <table align="center" class="style1">
        <tr>
        <td colspan="2" 
            
            style="text-align: center; font-size: x-large; font-weight: bold; color: #FF0000;" 
            class="style4">
            Toa Thuốc</td>
    </tr>
    <tr>
        <td class="style3">
            Tên Bệnh Nhân:</td>
        <td>
            <asp:TextBox ID="txtTenBenhNhan" runat="server" Height="24px" Width="150px" 
                Enabled="False" ReadOnly="True"></asp:TextBox>
            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
            <asp:Label ID="Label1" runat="server" Text="Ngày Lập:"></asp:Label>
            &nbsp;&nbsp;&nbsp;
            <asp:TextBox ID="txtNgayLapToaThuoc" runat="server" Width="150px" Height="24px" 
                Enabled="False" ForeColor="#3399FF" ReadOnly="True"></asp:TextBox>
        </td>
    </tr>
    <tr>
        <td class="style3">
            Tên Thuốc:</td>
        <td>
            <asp:TextBox ID="txtTenThuoc" runat="server" Height="24px" Width="224px"></asp:TextBox>
            <asp:AutoCompleteExtender ID="txtTenThuoc_AutoCompleteExtender" runat="server" 
                TargetControlID="txtTenThuoc"
                UseContextKey="True" BehaviorID="AutoCompleteEx" ServicePath="~/Tier/AutoComplete.asmx"
                ServiceMethod="GetListTenThuoc" MinimumPrefixLength="1" CompletionInterval="1000"
                EnableCaching="true" CompletionSetCount="20" CompletionListCssClass="autocomplete_completionListElement"
                CompletionListItemCssClass="autocomplete_listItem" CompletionListHighlightedItemCssClass="autocomplete_highlightedListItem"
                DelimiterCharacters=";, :" ShowOnlyCurrentWordInCompletionListItem="true">
                <animations>
                    <OnShow>
                        <Sequence>
                            <%-- Make the completion list transparent and then show it --%>
                            <OpacityAction Opacity="0" />
                            <HideAction Visible="true" />
                            
                            <%--Cache the original size of the completion list the first time
                                the animation is played and then set it to zero --%>
                            <ScriptAction Script="
                                // Cache the size and setup the initial size
                                var behavior = $find('AutoCompleteEx');
                                if (!behavior._height) {
                                    var target = behavior.get_completionList();
                                    behavior._height = target.offsetHeight - 2;
                                    target.style.height = '0px';
                                }" />
                            
                            <%-- Expand from 0px to the appropriate size while fading in --%>
                            <Parallel Duration=".4">
                                <FadeIn />
                                <Length PropertyKey="height" StartValue="0" EndValueScript="$find('AutoCompleteEx')._height" />
                            </Parallel>
                        </Sequence>
                    </OnShow>
                    <OnHide>
                        <%-- Collapse down to 0px and fade out --%>
                        <Parallel Duration=".4">
                            <FadeOut />
                            <Length PropertyKey="height" StartValueScript="$find('AutoCompleteEx')._height" EndValue="0" />
                        </Parallel>
                    </OnHide>
                </animations>
            </asp:AutoCompleteExtender>
        </td>
    </tr>
    <tr>
        <td class="style3">
            Số Lượng:</td>
        <td>
            <asp:TextBox ID="txtSoLuong" runat="server" Height="20px" Width="223px"></asp:TextBox>
        </td>
    </tr>
    <tr>
        <td class="style3">
            Chỉ Định:</td>
        <td>
&nbsp; Dùng :
            <asp:TextBox ID="txtDung" runat="server"></asp:TextBox>
&nbsp;
            <asp:Label ID="lblNgày" runat="server" Text="Trong Ngày"></asp:Label>
&nbsp;&nbsp;&nbsp; Lần:&nbsp;&nbsp;
            <asp:TextBox ID="txtLan" runat="server"></asp:TextBox>
            <asp:Label ID="lblDonVi" runat="server"></asp:Label>
        </td>
    </tr>
    <tr>
        <td class="style3">
            Chỉ Định Thêm:</td>
        <td>
            <asp:RadioButton ID="rbtnTruocAn" runat="server" Text="Trước Khi Ăn" 
                GroupName="chidinhthem" />
            <asp:RadioButton ID="rbtnSauAn" runat="server" Text="Sau Khi Ăn " 
                GroupName="chidinhthem" />
        </td>
    </tr>
    <tr>
        <td colspan="2">
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
            <asp:Button ID="btnThemDS" runat="server" Height="25px" Text="Thêm Thuốc" 
                Width="137px" onclick="btnThemDS_Click" />
            <asp:Button ID="btnQuayVe" runat="server" onclick="btnQuayVe_Click" 
                Text="Quay Về" />
            <br />
            <br />
            <table class="style1" style="border-style: solid">
                <tr>
                    <td style="font-size: large; font-weight: bolder; color: #0000FF">
                        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Chi Tiết Thuốc<br />
                        <asp:GridView ID="gvDanhSach" runat="server" Style="margin-top: 0px" Width="100%"
                AutoGenerateColumns="False" CellPadding="4" EnableModelValidation="True" ForeColor="#333333"
                GridLines="None" onrowdeleting="gvDanhSach_RowDeleting">
                <AlternatingRowStyle BackColor="White" />
                            <Columns>
                                <asp:BoundField DataField="MaChiTietDonThuoc" HeaderText="Ma Chi Tiet">
                                <ControlStyle Height="0px" Width="0px" />
                                <FooterStyle Width="0px" />
                                <HeaderStyle Height="0px" Width="0px" Wrap="False" />
                                <ItemStyle Height="0px" Width="0px" Wrap="False" />
                                </asp:BoundField>
                                <asp:BoundField DataField="TenThuoc" HeaderText="Ten Thuoc" />
                                <asp:BoundField DataField="SoLuong" HeaderText="So Luong" />
                                <asp:BoundField DataField="ChiDinh1" HeaderText="Chi Dinh 1" />
                                <asp:BoundField DataField="ChiDinh2" HeaderText="Chi Dinh 2" />
                                <asp:BoundField DataField="ChiDinhThem" HeaderText="Chi Dinh Them" />
                                <asp:CommandField HeaderText="Xoa" ShowDeleteButton="True" />
                            </Columns>
                            <EditRowStyle BackColor="#2461BF" />
                            <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                            <HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                            <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
                            <RowStyle BackColor="#EFF3FB" />
                            <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
                        </asp:GridView>
                    </td>
                </tr>
            </table>
            <br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
            <br />
        </td>
    </tr>
</table>
        </asp:Panel>
        <asp:Panel ID="pnlKQXetNghiem" runat="server">
        <div align="center">
            <asp:GridView ID="gvKetQuaXetNghiem" runat="server" Style="margin-top: 0px" Width="100%"
                AutoGenerateColumns="False" CellPadding="4" EnableModelValidation="True" ForeColor="#333333"
                GridLines="None" >
                <AlternatingRowStyle BackColor="White" />
                <Columns>
                    <asp:ButtonField ButtonType="Image" CommandName="MaPhieuKham" DataTextField="MaPhieuKham"
                        HeaderText="Bệnh án" ImageUrl="~/App_Themes/Guest/Images/icon-detail.png" Text="Button" />
                    <asp:BoundField DataField="MaPhieuKham" HeaderText="Mã phiếu khám" />
                    <asp:BoundField DataField="HoTen" HeaderText="Họ tên" />
                    <asp:BoundField DataField="GioiTinh" HeaderText="Giới tính" />
                    <asp:BoundField DataField="NgaySinh" HeaderText="Ngày sinh" />
                    <asp:BoundField DataField="SoDienThoai" HeaderText="Số điện thoại" />
                    <asp:BoundField DataField="QueQuan" HeaderText="Quê quán" />
                </Columns>
                <EditRowStyle BackColor="#2461BF" />
                <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                <HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
                <RowStyle BackColor="#EFF3FB" />
                <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
            </asp:GridView>
        </div>
        </asp:Panel> 
        <asp:Panel ID="pnlThongBao_ChuaCoToaThuoc" runat="server" 
            onload="pnlThongBao_ChuaCoToaThuoc_Load">
        <div align="center">
            <asp:Label ID="lblPanelThongBao" runat="server" Font-Bold="True" 
                Font-Size="X-Large" ForeColor="Red"></asp:Label>
        </div>
        <div>
            &nbsp;
        </div>
        <div align="center">
            <asp:Label ID="lblCauHoi" runat="server" 
                ForeColor="#CC99FF"></asp:Label>
        </div>
        <div align="center">
            <asp:Button ID="btnDongY" runat="server" Text="Có" onclick="btnDongY_Click" 
                Width="70px" />
            <asp:Button ID="btnKhongDongY" runat="server" Text="Không" 
                onclick="btnKhongDongY_Click" Width="70px" />
        </div>

        </asp:Panel>    
    </ContentTemplate>
</asp:UpdatePanel>